package com.ruoyi.study.paper.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.study.paper.mapper.StuPaperMapper;
import com.ruoyi.study.paper.domain.StuPaper;
import com.ruoyi.study.paper.service.IStuPaperService;

/**
 * 考试记录Service业务层处理
 * 
 * @author twj
 * @date 2023-05-18
 */
@Service
public class StuPaperServiceImpl implements IStuPaperService 
{
    @Autowired
    private StuPaperMapper stuPaperMapper;

    /**
     * 查询考试记录
     * 
     * @param id 考试记录主键
     * @return 考试记录
     */
    @Override
    public StuPaper selectStuPaperById(String id)
    {
        return stuPaperMapper.selectStuPaperById(id);
    }

    /**
     * 查询考试记录列表
     * 
     * @param stuPaper 考试记录
     * @return 考试记录
     */
    @Override
    public List<StuPaper> selectStuPaperList(StuPaper stuPaper)
    {
        return stuPaperMapper.selectStuPaperList(stuPaper);
    }

    /**
     * 新增考试记录
     * 
     * @param stuPaper 考试记录
     * @return 结果
     */
    @Override
    public int insertStuPaper(StuPaper stuPaper)
    {
        stuPaper.setCreateTime(DateUtils.getNowDate());
        return stuPaperMapper.insertStuPaper(stuPaper);
    }

    /**
     * 修改考试记录
     * 
     * @param stuPaper 考试记录
     * @return 结果
     */
    @Override
    public int updateStuPaper(StuPaper stuPaper)
    {
        stuPaper.setUpdateTime(DateUtils.getNowDate());
        return stuPaperMapper.updateStuPaper(stuPaper);
    }

    /**
     * 批量删除考试记录
     * 
     * @param ids 需要删除的考试记录主键
     * @return 结果
     */
    @Override
    public int deleteStuPaperByIds(String[] ids)
    {
        return stuPaperMapper.deleteStuPaperByIds(ids);
    }

    /**
     * 删除考试记录信息
     * 
     * @param id 考试记录主键
     * @return 结果
     */
    @Override
    public int deleteStuPaperById(String id)
    {
        return stuPaperMapper.deleteStuPaperById(id);
    }
}
